
package com.dhcc.bpm.modules.api.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.api.entity.Product;
import com.dhcc.bpm.modules.api.mapper.ProductMapper;
import com.dhcc.bpm.modules.api.service.IProductService;
import com.dhcc.bpm.modules.api.vo.OpcAppApiVo;
import com.dhcc.bpm.modules.api.vo.ProdListVo;
import com.dhcc.bpm.modules.api.vo.ProductVO;
import com.dhcc.bpm.modules.api.vo.productListVo;
import com.dhcc.bpm.modules.common.vo.SelectVo;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ProductServiceImpl
 * @Description 产品表 服务实现类
 * @Author daina
 * @Date 2020/2/25 15:22
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Service("opc_product")
public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, Product> implements IProductService {

	@Autowired
	private ProductMapper productMapper;

	@Override
	public IPage<ProductVO> selectProductPage(IPage<ProductVO> page, ProductVO product) {
		return page.setRecords(baseMapper.selectProductPage(page, product));
	}

	@Override
	public List<ProductVO> selectProductApiPage(ProductVO product) {
		return baseMapper.selectProductApiPage(product);
	}

	@Override
	public IPage<ProductVO> listAppProductPage(IPage<ProductVO> page, ProductVO product) {
		return page.setRecords(baseMapper.listAppProductPage(page, product));
	}
	@Override
	public Product getDetil(Product product) {
		return productMapper.selectDetil(product);
	}

	@Override
	public productListVo selectProductApiList(Long id, String apiIds) {
		return productMapper.selectProductApiList(id,apiIds);
	}

	@Override
	public productListVo selectById(Long id) {
		return productMapper.selectById(id);
	}

	@Override
	public List<OpcAppApiVo> selectAppApi(Long opcProductId) {
		return productMapper.selectAppApi(opcProductId);
	}

	/**
	 * @Description 产品信息集合
	 * @Author sjm
	 * @Date 19:12 2020/2/26 0026
	 * @param id
	 * @return java.util.List<com.dhcc.bpm.modules.api.vo.ProdListVo>
	 **/
	@Override
	public List<ProdListVo> selectProdList(Long id) {
		return productMapper.selectProdList(id);
	}

	/**
	 * @Description 根据产品id查询
	 * @Author sjm
	 * @Date 20:06 2020/3/3 0003
	 * @param id
	 * @return com.dhcc.bpm.modules.api.vo.productListVo
	 **/
	@Override
	public productListVo selectUserById(Long id) {
		return productMapper.selectUserById(id);
	}

	/**
	 * @Description 查询
	 * @Author sjm
	 * @Date 10:31 2020/3/4 0004
	 * @param id
	 * @return com.dhcc.bpm.modules.api.vo.productListVo
	 **/
	@Override
	public productListVo selectProById(Long id) {
		return productMapper.selectProById(id);
	}


	/**
	 * @Description 某一系统下产品集合
	 * @Author Mdd
	 * @Date 2020/3/11 11:53
	 * @param sysId 系统主键
	 * @return java.util.List<com.dhcc.bpm.modules.api.entity.Product>
	 **/
	@Override
	public List<Product> syslist(String sysId) {
		return productMapper.sysList(sysId);
	}

	/**
	 * @Description 查询已发布的产品
	 * @Author sjm
	 * @Date 15:06 2020/3/21 0021
	 * @param page
	 * @param product
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.api.vo.ProductVO>
	 **/
	@Override
	public IPage<ProductVO> fetchListRelease(IPage<ProductVO> page, ProductVO product) {
		return productMapper.fetchListRelease(page,product);
	}

	/**
	 * @Description 根据所属系统查询集合
	 * @Author sjm
	 * @Date 18:14 2020/3/28 0028
	 * @param opcSysId
	 * @return java.util.List<com.dhcc.bpm.modules.api.entity.BaseProduct>
	 **/
	@Override
	public List<Product> selectBySysId(Long opcSysId) {
		return productMapper.selectBySysId(opcSysId);
	}

	@Override
	public String findByProductCode(String productCode) {
		return productMapper.findByProductCode(productCode);
	}

	@Override
	public int updateStsByName(Product product) {
		return productMapper.updateStsByName(product);
	}

	@Override
	public Product selectProductByName(String productName) {
		return productMapper.selectProductByName(productName);
	}

	@Override
	public List<ProductVO> selectByProductCode(String productCode) {
		return productMapper.selectByProductCode(productCode);
	}

	@Override
	public List<ProductVO> selectProductApi(Long productId) {
		return productMapper.selectProductApi(productId);
	}

	@Override
	public List<ProductVO> selectProductList(ProductVO productVO) {
		return productMapper.selectProductList(productVO);
	}

	@Override
	public List<ProductVO> selectProductBySysId(ProductVO productVO) {
		return productMapper.selectProductBySysId(productVO);
	}

	@Override
	public List<ProductVO> selectProductByBaseProduct(ProductVO productVO) {
		return productMapper.selectProductByBaseProduct(productVO);
	}

	@Override
	public List<SelectVo> selectByProductName() {
		return productMapper.selectByProductName();
	}

	@Override
	public List<ProductVO> queryProduct() {
		return productMapper.queryProduct();
	}
}
